<?php

namespace app\admin\controller;

use think\Request;
use app\admin\model\NavFields as Fields;
use app\admin\controller\Base;
class NavFields extends Base
{

    public function configDict(Request $request){
        $p = ('\app\admin\model\\'.$request->controller());
        $m = new $p;
        $data = $m->where('type','config')->field('id,name')->select();
        $dicts = [];
        foreach($data as $r){
            $dicts[$r['id']] = $r['name'];
        }
        return msg::success($dicts);
    }

}
